Skip to content

allow custom cpu & ram#1242

Merged
alexcos20 merged 1 commit intomainfrom
feature/allow_cpu_ram_custom
Mar 2, 2026
Merged

allow custom cpu & ram#1242
alexcos20 merged 1 commit intomainfrom
feature/allow_cpu_ram_custom

Conversation

@alexcos20
Copy link
Member

Changes proposed in this PR:

  • if 'cpu' or 'ram' are present in config, use those values, otherwise use defaults

@alexcos20
Copy link
Member Author

/run-security-scan

Copy link
Member Author

@alexcos20 alexcos20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI automated code review (Gemini 3).

Overall risk: low

Summary:
This PR enhances the C2D Docker engine to allow customization of CPU and RAM resource limits (total, max, min) via the envConfig.resources configuration. It initializes default resource values based on system information (sysinfo) and then applies any specified overrides from the environment configuration, improving flexibility in resource allocation for compute jobs.

Comments:
• [INFO][other] The PR correctly applies custom total, max, and min values for CPU and RAM. It might be beneficial to consider adding explicit validation (e.g., min <= max <= total) here or ensure it's handled upstream when envConfig.resources is parsed, to prevent scenarios where custom values could lead to invalid resource configurations. This would enhance the robustness of the resource setup.
• [INFO][style] The current approach of creating cpuResources and ramResources objects first and then updating them based on envConfig is clear and functional. The if (res.total) checks are good for robustness against partial envConfig entries. If envConfig.resources entries for CPU/RAM are always expected to provide all three (total, max, min) when present, a slightly more concise assignment without the if checks could be used, but the current approach is safer.

@alexcos20 alexcos20 merged commit c00d366 into main Mar 2, 2026
11 checks passed
@alexcos20 alexcos20 deleted the feature/allow_cpu_ram_custom branch March 2, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants